<template>
  <div>
      <van-field label="请输入手机号" v-model="mobile"/>
      <van-field label="请输入验证码" v-model="code"/>
      <van-button @click="send">点击发送验证码</van-button>
      <van-button @click="login">登录</van-button>
  </div>
</template>

<script>
export default {
    data(){
        return{
            mobile:'',
            code:''
        }
    },
    methods:{
        send(){
            this.axios.post('sendSms',{'mobile':this.mobile}).then(res=>{
                alert(res.data.mes)
            })
        },
        login(){
            this.axios.post('tlogin',{'mobile':this.mobile,'code':this.code}).then(res=>{
                alert(res.data.mes)
            })
        }
    },
}
</script>

<style>

</style>